namespace GeoWeb.Demo.WorkDataConfig
{
    using System;
    using GeoWeb.DataContext;


    /// <summary>
    /// 表名：GeoWorkDay 主键列：
    /// </summary>
    [SerializableAttribute()]
    public partial class GeoWorkDay : Entity
    {

        protected Int32 _ID;

        protected Int32? _ClassID;

        protected Int32? _WeekDay;

        protected Int32? _Day_year;

        protected Int32? _Day_month;

        protected Int32? _Day_day;

        protected DateTime? _Day_Fulldate;

        protected Int32? _DaY_IsWorkDay;

        protected DateTime? _AddDate;

        public Int32 ID
        {
            get
            {
                return this._ID;
            }
            set
            {
                this.OnPropertyValueChange(_.ID, _ID, value);
                this._ID = value;
            }
        }

        public Int32? ClassID
        {
            get
            {
                return this._ClassID;
            }
            set
            {
                this.OnPropertyValueChange(_.ClassID, _ClassID, value);
                this._ClassID = value;
            }
        }

        public Int32? WeekDay
        {
            get
            {
                return this._WeekDay;
            }
            set
            {
                this.OnPropertyValueChange(_.WeekDay, _WeekDay, value);
                this._WeekDay = value;
            }
        }

        public Int32? Day_year
        {
            get
            {
                return this._Day_year;
            }
            set
            {
                this.OnPropertyValueChange(_.Day_year, _Day_year, value);
                this._Day_year = value;
            }
        }

        public Int32? Day_month
        {
            get
            {
                return this._Day_month;
            }
            set
            {
                this.OnPropertyValueChange(_.Day_month, _Day_month, value);
                this._Day_month = value;
            }
        }

        public Int32? Day_day
        {
            get
            {
                return this._Day_day;
            }
            set
            {
                this.OnPropertyValueChange(_.Day_day, _Day_day, value);
                this._Day_day = value;
            }
        }

        public DateTime? Day_Fulldate
        {
            get
            {
                return this._Day_Fulldate;
            }
            set
            {
                this.OnPropertyValueChange(_.Day_Fulldate, _Day_Fulldate, value);
                this._Day_Fulldate = value;
            }
        }

        public Int32? DaY_IsWorkDay
        {
            get
            {
                return this._DaY_IsWorkDay;
            }
            set
            {
                this.OnPropertyValueChange(_.DaY_IsWorkDay, _DaY_IsWorkDay, value);
                this._DaY_IsWorkDay = value;
            }
        }

        public DateTime? AddDate
        {
            get
            {
                return this._AddDate;
            }
            set
            {
                this.OnPropertyValueChange(_.AddDate, _AddDate, value);
                this._AddDate = value;
            }
        }

        /// <summary>
        /// 获取实体对应的表名
        /// </summary>
        protected override Table GetTable()
        {
            return new Table<GeoWorkDay>("GeoWorkDay");
        }

        /// <summary>
        /// 获取实体中的标识列
        /// </summary>
        protected override Field GetIdentityField()
        {
            return _.ID;
        }

        /// <summary>
        /// 获取列信息
        /// </summary>
        protected override Field[] GetFields()
        {
            return new Field[] {
                        _.ID,
                        _.ClassID,
                        _.WeekDay,
                        _.Day_year,
                        _.Day_month,
                        _.Day_day,
                        _.Day_Fulldate,
                        _.DaY_IsWorkDay,
                        _.AddDate};
        }

        /// <summary>
        /// 获取列数据
        /// </summary>
        protected override object[] GetValues()
        {
            return new object[] {
                        this._ID,
                        this._ClassID,
                        this._WeekDay,
                        this._Day_year,
                        this._Day_month,
                        this._Day_day,
                        this._Day_Fulldate,
                        this._DaY_IsWorkDay,
                        this._AddDate};
        }

        /// <summary>
        /// 给当前实体赋值
        /// </summary>
        protected override void SetValues(IRowReader reader)
        {
            if ((false == reader.IsDBNull(_.ID)))
            {
                this._ID = reader.GetInt32(_.ID);
            }
            if ((false == reader.IsDBNull(_.ClassID)))
            {
                this._ClassID = reader.GetInt32(_.ClassID);
            }
            if ((false == reader.IsDBNull(_.WeekDay)))
            {
                this._WeekDay = reader.GetInt32(_.WeekDay);
            }
            if ((false == reader.IsDBNull(_.Day_year)))
            {
                this._Day_year = reader.GetInt32(_.Day_year);
            }
            if ((false == reader.IsDBNull(_.Day_month)))
            {
                this._Day_month = reader.GetInt32(_.Day_month);
            }
            if ((false == reader.IsDBNull(_.Day_day)))
            {
                this._Day_day = reader.GetInt32(_.Day_day);
            }
            if ((false == reader.IsDBNull(_.Day_Fulldate)))
            {
                this._Day_Fulldate = reader.GetDateTime(_.Day_Fulldate);
            }
            if ((false == reader.IsDBNull(_.DaY_IsWorkDay)))
            {
                this._DaY_IsWorkDay = reader.GetInt32(_.DaY_IsWorkDay);
            }
            if ((false == reader.IsDBNull(_.AddDate)))
            {
                this._AddDate = reader.GetDateTime(_.AddDate);
            }
        }

        public override int GetHashCode()
        {
            return base.GetHashCode();
        }

        public override bool Equals(object obj)
        {
            if ((obj == null))
            {
                return false;
            }
            if ((false == typeof(GeoWorkDay).IsAssignableFrom(obj.GetType())))
            {
                return false;
            }
            if ((((object)(this)) == ((object)(obj))))
            {
                return true;
            }
            return false;
        }

        public class _
        {

            /// <summary>
            /// 表示选择所有列，与*等同
            /// </summary>
            public static AllField All = new AllField<GeoWorkDay>();

            /// <summary>
            /// 字段名：ID - 数据类型：Int32
            /// </summary>
            public static Field ID = new Field<GeoWorkDay>("ID");

            /// <summary>
            /// 字段名：ClassID - 数据类型：Nullable`1
            /// </summary>
            public static Field ClassID = new Field<GeoWorkDay>("ClassID");

            /// <summary>
            /// 字段名：WeekDay - 数据类型：Nullable`1
            /// </summary>
            public static Field WeekDay = new Field<GeoWorkDay>("WeekDay");

            /// <summary>
            /// 字段名：Day_year - 数据类型：Nullable`1
            /// </summary>
            public static Field Day_year = new Field<GeoWorkDay>("Day_year");

            /// <summary>
            /// 字段名：Day_month - 数据类型：Nullable`1
            /// </summary>
            public static Field Day_month = new Field<GeoWorkDay>("Day_month");

            /// <summary>
            /// 字段名：Day_day - 数据类型：Nullable`1
            /// </summary>
            public static Field Day_day = new Field<GeoWorkDay>("Day_day");

            /// <summary>
            /// 字段名：Day_Fulldate - 数据类型：Nullable`1
            /// </summary>
            public static Field Day_Fulldate = new Field<GeoWorkDay>("Day_Fulldate");

            /// <summary>
            /// 字段名：DaY_IsWorkDay - 数据类型：Nullable`1
            /// </summary>
            public static Field DaY_IsWorkDay = new Field<GeoWorkDay>("DaY_IsWorkDay");

            /// <summary>
            /// 字段名：AddDate - 数据类型：Nullable`1
            /// </summary>
            public static Field AddDate = new Field<GeoWorkDay>("AddDate");
        }
    }
}
